import config from "@/config"
import http from "@/utils/request"

export default {
	list: {
		url: `${config.API_URL1}/product/`,
		name: "获取产品列表",
		get: async function (params) {
			return await http.get(this.url, params);
		}
	},
	add: {
		url: `${config.API_URL1}/product/`,
		name: "添加产品",
		post: async function (data) {
			return await http.post(this.url, data);
		}
	},
	edit: {
		url: `${config.API_URL1}/product/`,
		name: "修改产品",
		put: async function (id, data) {
			return await http.put(`${this.url}${id}/`, data);
		}
	},
	del: {
		url: `${config.API_URL1}/product/`,
		name: "删除产品",
		delete: async function (id) {
			return await http.delete(`${this.url}${id}/`);
		}
	},
	category_list: {
		url: `${config.API_URL1}/product/category_list/`,
		name: "获取全部产品类别",
		get: async function (params) {
			return await http.get(this.url, params);
		}
	},
	brand_list: {
		url: `${config.API_URL1}/product/brand_list/`,
		name: "获取全部产品品牌",
		get: async function (params) {
			return await http.get(this.url, params);
		}
	},
}
